#include <set>
#include <stdio.h>

int main(int argc, char **argv) {
    std::set<int> test = {1, 2, 3, 4, 6 , 5};

    for (const auto& num : test)
        printf("%d\n", num);

    for(auto it = test.begin(); it != test.end();) {
        if (*it % 2 == 0)
            it = test.erase(it);
        else
            ++it;
    }

    printf("-----------------------\n");
    for (const auto& num : test)
        printf("%d\n", num);

    return 0;
}
